/**
 * 主题定义文件
 * 支持多个页面定义，现在仅支持阅读器，将来会逐步支持首页和书籍详情页
 * 主题分为默认、淡黄、护眼、夜间
 */
import { get } from './index';

const READER_THEME = {
  default: {
    displayColor: {
      default: '#FDFDFD',
      yellow: '#F5F0DD',
      green: '#C8EECD',
      dark: '#222431'
    },
    pageBackground: '#F4F4F6',
    basicTextColor: '#353535',
    menuTextColor: '#61666A',
    menuActiveColor: '#1E84EC',
    menuBackground: '#FDFDFD',
    menuShadowColor: '#e8e4e4',
    slideLeftColor: '#777777',
    slideRightColor: '#DCDCDC',
    currentThemeBorderColor: '#777777',
    splitLineColor: '#f1f1f1',
    muluSearchBackground: '#F1F2F7',
    muluSearchIconColor: '#888B90',
    muluSearchPlaceholder: '#B7BABF',
    muluCurrentChapterColor: '#8ABFDD',
    muluRightArrowColor: '#AEAEB0',
    muluSubTextColor: '#737373',
    leftBtnBackground: '#5F636F',
    leftBtnTextColor: '#FDFDFB'
  },

  yellow: {
    displayColor: {
      default: '#FDFDFD',
      yellow: '#F3F0DD',
      green: '#C8EECD',
      dark: '#252430'
    },
    pageBackground: '#F3ECD5',
    basicTextColor: '#090101',
    menuTextColor: '#665E52',
    menuActiveColor: '#AD772D',
    menuBackground: '#FBF4E4',
    menuShadowColor: '#eae3d3',
    slideLeftColor: '#766E62',
    slideRightColor: '#D8D0C5',
    currentThemeBorderColor: '#7B7367',
    splitLineColor: '#f1ebdd',
    muluSearchBackground: '#EEE8D8',
    muluSearchIconColor: '#A59F8F',
    muluSearchPlaceholder: '#B4AD9D',
    muluCurrentChapterColor: '#A28448',
    muluRightArrowColor: '#ADA797',
    muluSubTextColor: '#A3A493',
    leftBtnBackground: '#5F5C57',
    leftBtnTextColor: '#F8F3E1'
  },

  green: {
    displayColor: {
      default: '#FEFEFE',
      yellow: '#F8F1DF',
      green: '#CDF0D0',
      dark: '#232636'
    },
    pageBackground: '#C2ECCA',
    basicTextColor: '#050F02',
    menuTextColor: '#31402e',
    menuActiveColor: '#339617',
    menuBackground: '#CDF0D0',
    menuShadowColor: '#b0d6b3',
    slideLeftColor: '#5F7363',
    slideRightColor: '#B0D5B4',
    currentThemeBorderColor: '#5E7459',
    splitLineColor: '#bee2bf',
    muluSearchBackground: '#C1E4C4',
    muluSearchIconColor: '#7A9779',
    muluSearchPlaceholder: '#86AA8A',
    muluCurrentChapterColor: '#318A29',
    muluRightArrowColor: '#78997A',
    muluSubTextColor: '#638062',
    leftBtnBackground: '#4A554B',
    leftBtnTextColor: '#BBD9BB'
  },

  dark: {
    displayColor: {
      default: '#C9C9C9',
      yellow: '#C7BEAD',
      green: '#A1BEA1',
      dark: '#1E1D25'
    },
    pageBackground: '#010101',
    basicTextColor: '#656565',
    menuTextColor: '#8E9196',
    menuActiveColor: '#1B76BC',
    menuBackground: '#12151B',
    menuShadowColor: '#000000',
    slideLeftColor: '#7A7C81',
    slideRightColor: '#22242A',
    currentThemeBorderColor: '#787B81',
    splitLineColor: '#1E2026',
    muluSearchBackground: '#2A2C31',
    muluSearchIconColor: '#878A8F',
    muluSearchPlaceholder: '#616469',
    muluCurrentChapterColor: '#2770AE',
    muluRightArrowColor: '#5C5F64',
    muluSubTextColor: '#474A4F',
    leftBtnBackground: '#919297',
    leftBtnTextColor: '#EBEBEB'
  }
};

const THEME = { READER_THEME };

export function getThemeValue(page, theme = 'default', name) {
  return THEME[page] ? get(THEME[page][theme], name, '') : '';
}

export function getThemeConfig(page, theme = 'default') {
  return THEME[page] ? THEME[page][theme] : '';
}
